<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/

namespace phpbb\cron;

use common\library\CurlTrait;
use Yii;
use common\base\BaseService;

/**
* Cron manager class.
*
* Finds installed cron tasks, stores task objects, provides task selection.
*/
class manager
{
	/**
	* Set of \phpbb\cron\task\wrapper objects.
	* Array holding all tasks that have been found.
	*
	* @var array
	*/
	protected $tasks = array();

	protected $phpbb_root_path;
	protected $php_ext;

	/**
	* Constructor. Loads all available tasks.
	*
	* @param array|\Traversable $tasks Provides an iterable set of task names
	* @param string $phpbb_root_path Relative path to phpBB root
	* @param string $php_ext PHP file extension
	*/
	public function __construct($tasks, $phpbb_root_path, $php_ext)
	{
		$this->phpbb_root_path = $phpbb_root_path;
		$this->php_ext = $php_ext;

		$this->load_tasks($tasks);
	}
}
